import http from '@/utils/http';

export function getList(page,pageSize,name,type) {
  return http.get('/category/list',{
    params:{
        page,
        pageSize,
        name,
        type
    }
  })
}

export function deleteCategory(id) {
    return http.delete(`/category/delete/${id}`) 
}

export function addCategory(data) {
    return http.post('/category/add',data)
}     

export function updateCategory(data) {
  return http.put('/category/update',data)
}     

export function editStatus(id,status){
    return http.put(`/category/editStatus/${id}/${status}`)

}

export function getCategories(type) {
  return http.get(`/category/listByType/${type}`)
}